import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    lang: "zh_cn",
    newCoordinate: [],//添加经纬度记录
    instryType: 'one',//记录当前操作的类型
    applyCoordinate: [],//申报经纬度记录
    CoordinateType: 'add',//当前坐标拾取对应的值

    dataArr: [
      { ID: 1, coon: '113.911991,30.801348', slid: 'SL1', num: 526 },
      { ID: 2, coon: '113.997135,30.936904', slid: 'SL2', num: 371 },
      { ID: 3, coon: '113.729686,30.881821', slid: 'SL3', num: 214 },
      { ID: 4, coon: '113.928981,30.645837', slid: 'SL4', num: 106 },
      { ID: 5, coon: '113.908381,30.47792', slid: 'SL5', num: 385 },
      { ID: 6, coon: '114.015498,30.608022', slid: 'SL6', num: 214 },
      { ID: 7, coon: '114.362254,31.073764', slid: 'SL7', num: 487 },
      { ID: 8, coon: '114.713816,31.227725', slid: 'SL8', num: 239 },
      { ID: 9, coon: '115.323558,31.130206', slid: 'SL9', num: 462 },
      { ID: 10, coon: '115.327677,31.452925', slid: 'SL10', num: 351 },
      { ID: 11, coon: '115.039286,31.493919', slid: 'SL11', num: 89 },
      { ID: 12, coon: '114.950089,30.205599', slid: 'SL12', num: 264 },
      { ID: 13, coon: '115.024934,29.978059', slid: 'SL13', num: 198 },
      { ID: 14, coon: '115.723939,30.16702', slid: 'SL14', num: 174 },
      { ID: 15, coon: '115.283113,30.553317', slid: 'SL15', num: 298 },
      { ID: 16, coon: '114.777741,30.391163', slid: 'SL16', num: 651 }
    ]

  },
  mutations: {
    langChange(state, lang) {
      state.lang = lang
    },
    getCoordinate(state, newCoordinate) {
      // 拾取坐标
      state.newCoordinate = newCoordinate
    },
    getapplyCoordinate(state, newCoordinate) {
      // 拾取坐标
      state.applyCoordinate = newCoordinate
    },
    changeinstryType(state, type) {
      state.instryType = type
    },

    changeCoordinateType(state, type) {
      state.CoordinateType = type
    }
  },
  actions: {
  },
  modules: {
  }
})
